<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	template="../pages/template.xhtml">
	<ui:define name="head">
		<title>#{msg.documentos}</title>
	</ui:define>
	<ui:define name="center">
		<h:form prependId="false" styleClass="formPrincipal">
			<p:growl id="msgs" showDetail="true" />
			<p:ajaxStatus style="width:16px;height:16px;">
				<f:facet name="start">
					<h:graphicImage value="../images/loading.gif" />
				</f:facet>
				<f:facet name="complete">
					<h:outputText value="" />
				</f:facet>
			</p:ajaxStatus>
			<p:panel header="#{msg.buscarDocumento}"
				style="margin-left: 550px;width:308px;">
				<h:panelGrid columns="2">
					<p:inputText value="#{documentosBean.cadena}"></p:inputText>
					<p:commandButton value="#{msg.buscar}" update="tree"
						action="#{documentosBean.buscar}" ajax="true"></p:commandButton>
				</h:panelGrid>

			</p:panel>
			<br />
			<p:tree value="#{documentosBean.root}" var="doc" cache="true"
				style="margin-left: 550px;" id="tree"
				selection="#{documentosBean.seleccionado}" selectionMode="single">
				<p:treeNode expandedIcon="ui-icon-folder-open"
					collapsedIcon="ui-icon-folder-collapsed">
					<h:outputText value="#{doc}" />
				</p:treeNode>
				<p:treeNode type="document" icon="ui-icon-document">
					<h:outputText value="#{doc}" />
				</p:treeNode>
			</p:tree>
			<p:commandLink value="#{msg.descargar}"
				action="#{documentosBean.descargar}" style="margin-left: 550px;"
				ajax="false"></p:commandLink>

		</h:form>
	</ui:define>
</ui:composition>